package com.andnnl.service;

import com.andnnl.api.demo.DemoService;
import org.apache.dubbo.config.annotation.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;

/**
 * Created by chenss on 2019/8/16.
 */
@Service(version = "1.0.0")
public class DefaultDemoService implements DemoService {
    private final Logger logger = LoggerFactory.getLogger(getClass());
    /**
     * The default value of ${dubbo.application.name} is ${spring.application.name}
     */
    @Value("${dubbo.application.name}")
    private String serviceName;

    public String sayHello(String name) {
        String s= String.format("[%s] : Hello, %s", serviceName, name);
        logger.info(s);
        return s;
    }
}
